#include <bitset>

class Solution
{
public:
	int getSum(int a, int b)
	{
		const auto length = sizeof(unsigned int) * 8;
		auto ua = static_cast<unsigned int>(a);
		auto ub = static_cast<unsigned int>(b);
		std::bitset<length> ba, bb, bc;
		unsigned int mask = 1;
		int carry = 0;
		for (size_t i = 0; i < length; i++) {
			int acc = carry;
			carry = 0;
			auto bita = ua & mask;
			if (bita)
				if (acc) {
					acc = 0;
					carry = 1;
				} else {
					acc = 1;
				}
			auto bitb = ub & mask;
			if (bitb) {
				if (acc) {
					acc = 0;
					carry = 1;
				} else {
					acc = 1;
				}
			}
			bc[i] = acc;
			mask = mask << 1;
		}
		return *reinterpret_cast<int*>(&bc);
	}
};